//
//  CustomBtn.m
//  cm
//
//  Created by suyibaishan on 2017/10/31.
//  Copyright © 2017年 feihu. All rights reserved.
//

#import "CustomBtn.h"

@implementation CustomBtn

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        [self setTitleColor:[UIColor colorWithRed:0.32 green:0.32 blue:0.32 alpha:1] forState:UIControlStateNormal];
//        [self setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

//取消按钮的高亮状态
-(void)setHighlighted:(BOOL)highlighted
{
    
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    return CGRectMake(0, 45, contentRect.size.width, 20);
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    return CGRectMake((contentRect.size.width - 32)/2, 10, 32, 32);
}

@end
